import request from '@/utils/request.js'

//获取用户列表
export function getUserList(data) {
  return request({
    url: '/ScmDo/userList',
    method: 'post',
    data:data
  })
}

// 获取选中用户
export function getUserOne(usercode) {
  return request({
    url:`/ScmDo/userList?usercode=${usercode}`,
    method: 'get'
  })
}

//增加用户
export function addUser(data) {
  return request({
    url: '/ScmDo/userAdd',
    method: 'post',
    data:data
  })
}

//批量导入用户
export function  batchAdd(data) {
  return request({
    url:'/ScmDo/batchAdd',
    method:'post',
    data:data
  })
}

//编辑
export function editUser(data) {
  return request({
    url: '/ScmDo/userEdit',
    method: 'post',
    data:data
  })
}

//删除用户
export function delUser(ids){
  return request({
    url:`/ScmDo/userDel?id=${ids}`,
    method:'get'
  })
}

//获取角色列表
export function getRoleList(){
  return request({
    url:'/ScmDo/getRoleList',
    method:'get'
  })
}

//登陆
export function login(data){
  return request({
    url:'/ScmDo/login',
    method:'post',
    data:data
  })
}